<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>美食汇_订餐</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
        {% load staticfiles %}
    <style>
        .on{
            border: red solid;
        }
    </style>
 <!-- 新 Bootstrap 核心 CSS 文件 -->
<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">

<!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>

<!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>


    <script src="{% static 'js/jquery-3.4.1.js' %}" type="text/javascript" charset="utf-8"></script>

</head>
<body>
<div class="container">
	<div class="row clearfix">
		<div class="col-md-12 column">
		<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
				<div class="navbar-header">
					 <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> <span class="sr-only">Toggle navigation</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button> <a class="navbar-brand" style="margin-left: 180px" href="#">@美食汇@</a>
				</div>
				
				<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
					<ul class="nav navbar-nav">
						<li>
							 <a href="/">开始点餐</a>
						</li>
						<li>
							 <a href="/order/comment/">评论专区</a>
						</li>
					</ul>
					
					<ul class="nav navbar-nav navbar-right">
						<li>
							 <a href="/order/">我的订单</a>
						</li>
                        <li>
							 <a href="/order/car/">我的购物车
                             {% if car_num %}
                                <span class="badge" style="background-color: red;">{{ car_num }}</span>
                             {% endif %}
                             </a>
						</li>
						<li class="dropdown" style="margin-right: 180px">
							{% if user %}
								<a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ myuser }}<b class="caret"></b>&emsp;
								</a>
								<ul class="dropdown-menu">
									<li><a href="/logreg/user_data/"><span class="glyphicon glyphicon-user"> 地址管理</span></a></li>
									<li class="divider"></li>
									<li><a href="/logreg/out_log/"><span class="glyphicon glyphicon-off"> 退出登录</span></a></li>
								</ul>
							{% else %}
								<a href="#" class="dropdown-toggle" data-toggle="dropdown">
									去登录<b class="caret"></b>&emsp;
								</a>
								<ul class="dropdown-menu">
									<li><a href="/logreg/"><span class="glyphicon glyphicon-list-alt"> 注册</span></a></li>
									<li class="divider"></li>
									<li><a href="/logreg/log/"><span class="glyphicon glyphicon-flag"> 登录</span></a></li>
								</ul>
							{% endif %}

						</li>
					</ul>
				</div>
				
			</nav>
			<nav class="navbar navbar-default" role="navigation">

			</nav>
			<div class="jumbotron" style="background-image: url('../media/images/beijin.jpg');color: #ffffff">
				<h1>
					美食汇
				</h1>
				<p>
					唯美食与你不可辜负~
				</p>
			</div>
		</div>
	</div>
    {% block order %}
    {% endblock order %}
    {% block order_2 %}
    {% endblock order_2 %}
    {% if order_ok %}
	<div class="row clearfix">
		<div class="col-md-8 column">
            {% block main %}
            {% endblock main %}
		</div>
		<div class="col-md-4 column">
            {% include '推荐.html' %}

            <hr>
            <div id="myCarousel" class="carousel slide">
                        <!-- 轮播（Carousel）指标 -->
                        <ol class="carousel-indicators">
                            <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
                            <li data-target="#myCarousel" data-slide-to="1"></li>
                            <li data-target="#myCarousel" data-slide-to="2"></li>
                        </ol>
                        <!-- 轮播（Carousel）项目 -->
                        <div class="carousel-inner">
                            <div class="item active">
                                <img src="../media/upload/2019/08/30/b648c710f6f6b4c1ab04f9d28d64cjpeg_UdHKulf.webp" alt="First slide">
                            </div>
                            <div class="item">
                                <img src="../media/upload/2019/08/30/b648c710f6f6b4c1ab04f9d28d64cjpeg_YLyvfGV.webp" alt="Second slide">
                            </div>
                            <div class="item">
                                <img src="../media/upload/2019/08/30/b648c710f6f6b4c1ab04f9d28d64cjpeg.webp" alt="Third slide">
                            </div>
                        </div>
                        <!-- 轮播（Carousel）导航 -->
                        <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
                            <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
                            <span class="sr-only">Previous</span>
                        </a>
                        <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
                            <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
                            <span class="sr-only">Next</span>
                        </a>
            </div>
            <hr>
					<dl>
						<dt>
							商家信息
						</dt>
						<dd>
							北京美食汇股份有限公司
						</dd>
						<dd>
							投诉建议:400-820-8820
						</dd>
						<dd>
							公司地址:北京市朝阳区望京西路9527号
						</dd>

					</dl>

		</div>
    {% endif %}

	</div>

</div>
<br>
<br>
<div class="row clearfix">
		<div class="jumbotron">
            <div  style="text-align: center;"  class="container">
                <h4>版权所有© 北京美食汇股份有限公司</h4>
                <h6>关于美食汇 | About Tencent | 服务协议 | 隐私政策 | 开放平台 | 商务洽谈 | 美食外卖 | 美食公益 | 客服中心 | 网站导航 | 客户端下载 | 版权所有<br>
        北京举报中心 | 北京公安局 | 抵制违法广告承诺书 | 版权保护投诉指引 | 北京市通管局<br>
        粤网文[2017]6138-1456号 新出网证（粤）字010号 网络视听许可证1904073号 增值电信业务经营许可证：粤B2-20090059 B2-20090028<br>
        新闻信息服务许可证 粤府新函[2001]87号 违法和不良信息举报电话：0755-83765566-9 粤公网安备 44030002000001号<br>
        互联网食品信息服务资格证书 （粤）—非营业性—2017-0153<br>
        Copyright 1998 - 2019 Tencent. All Rights Reserved</h6>
                <img src="../media/images/备案信息.png" width="480">
        </div>
</div>
	</div>
<script type="text/javascript">
$('.type').click(function () {
            $('.type').removeClass('active');
            $(this).addClass('active')
        });

$('.ali_wechat').click(function () {
            $('.ali_wechat').removeClass('on');
            $(this).addClass('on')
        });
$('#go_pay').click(function () {
            var pay_def = $('.ali_wechat.on').attr('name');

            $("input[ name='pay_def' ]").val(pay_def);

            var href = $(this).attr("href");
            $("form").attr("action", href).submit();
            return false;
        });
$('#pro').change(function () {
    var pro = $(this).val();

    $.ajax({
        type:'post',
        url:'/logreg/user_data/',
        data:'pro='+pro+'&type=pro123',
        success:function (data) {
            var city = $('#city');
            city.empty();
            for (var i = 0; i < data.city.length; i++) {
                var c = '<option value='+data.city[i].id+'>'+data.city[i].name+'</option>';
                $(c).appendTo(city)
            {# 改变省的同时默认显示第一个城市的下辖县#}
            var area = $('#area');
            area.empty();
            for (var i = 0; i < data.area.length; i++) {
                var v = '<option value='+data.area[i].id+'>'+data.area[i].name+'</option>';
                $(v).appendTo(area)
            }
            }
        }
    })

});
    $('#city').change(function () {
    var city = $(this).val();

    $.ajax({
        type:'post',
        url:'/logreg/user_data/',
        data:'city='+city+'&type=city123',
        success:function (data) {
            var area = $('#area');
            area.empty();
            for (var i = 0; i < data.area.length; i++) {
                var c = '<option value='+data.area[i].id+'>'+data.area[i].name+'</option>';
                $(c).appendTo(area)
            }
        }
    })

});
            $('#submit').click(function () {

                    var href = $(this).attr("href");
                    var tel = $("#dh").val();
                    var pro = $("#pro option:selected").text();
                    var city = $("#city option:selected").text();
                    var area = $("#area option:selected").text();
                    var address_all = $('#address_all').val();

                    $("input[ name='tel' ]").val(tel);
                    $("input[ name='pro' ]").val(pro);
                    $("input[ name='city' ]").val(city);
                    $("input[ name='area' ]").val(area);
                    $("input[ name='address_all' ]").val(address_all);

                    $("form").attr("action", href).submit();
                    return false;
                });
</script>
</body>
</html>